import React from "react";
import { Checkbox } from "antd-mobile";
import "./index.scss";
const YHAgreeItem = props => {
	const { children, onChange, onClick } = props;

	const clickHandle = e => {
		e.preventDefault();
		if (onClick) {
			onClick(e);
		}
	};
	const onChangeHandle = e => {
		if (onChange) {
			onChange(e);
		}
	};
	return (
		<div className="agreeItem-component-wrapper-checkbox">
			<Checkbox onChange={onChangeHandle}>
				<div className="text">
					阅读并同意<a onClick={clickHandle}>{children}</a>
				</div>
			</Checkbox>
		</div>
	);
};
export default YHAgreeItem;
